<!--复制自member-list,重命名啊，测试完删除-->
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>会员管理系统</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
  <link rel="stylesheet" href="css/font.css">
  <link rel="stylesheet" href="css/xadmin.css">
  <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
  <script type="text/javascript" src="lib/layui/layui.js" charset="utf-8"></script>
  <script type="text/javascript" src="js/xadmin.js"></script>
  <script type="text/javascript" src="js/cookie.js"></script>

</head>
<body>
<blockquote class="layui-elem-quote"><a style="margin-left: 30px">用户信息</a></blockquote>
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
  <legend>用户信息</legend>
</fieldset>
<div style="display: flex">
<div class="layui-form" style="width: 500px">
  <div class="layui-form-item">
    <label class="layui-form-label">用户名</label>
    <div class="layui-input-block" >
      <input type="text" name="UName" lay-verify="UName" autocomplete="off"  class="layui-input" style="width: 80%" id="UName">
      
    </div>
  </div>
  <div class="layui-form-item" >
    <label class="layui-form-label">手机号码</label>
    <div class="layui-input-block">
      <input type="text" name="Phone" lay-verify="Phone" autocomplete="off"  class="layui-input" style="width: 80%" id="Phone">
    </div>
  </div>
  <div class="layui-form-item" >
    <label class="layui-form-label">地址</label>
    <div class="layui-input-block">
      <input type="text" name="Address" lay-verify="Address" autocomplete="off"  class="layui-input" style="width: 80%" id="Address">
    </div>
  </div>
  <button class="layui-btn layui-btn-sm" onclick="openPage()" style="margin-top: 20px;margin-left: 40%">修改信息</button>
</div>

<div class="x-body">

  <div id="main" style="width: 700px;height:300px;"></div>

</div>
<script src="//cdn.bootcss.com/echarts/3.3.2/echarts.min.js" charset="utf-8"></script>
<script type="text/javascript">
  // 基于准备好的dom，初始化echarts实例
  var myChart = echarts.init(document.getElementById('main'));

  // 指定图表的配置项和数据
  var option = {
    title: {
      text: '一周登入统计'
    },
    tooltip: {
      trigger: 'axis'
    },
    legend: {
      data:['登入次数']
    },
    grid: {
      left: '3%',
      containLabel: true
    },
    toolbox: {
      feature: {
        saveAsImage: {}
      }
    },
    xAxis: {
      type: 'category',
      boundaryGap: false,
      data: ['周一','周二','周三','周四','周五','周六','周日']
    },
    yAxis: {
      type: 'value'
    },
    series: [
      {
        name:'登入次数',
        type:'line',
        stack: '总量',
        data:[5, 10, 5, 6, 8, 0, 12]
      }
    ]
  };


  // 使用刚指定的配置项和数据显示图表。
  myChart.setOption(option);
</script>
</div>

<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
  <legend>用户以往信息</legend>
</fieldset>
<table class="layui-hide" id="Member" lay-filter="Member" ></table>

<fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;">
</fieldset>

<script>
  var index;//保存layuiEditID
  $(function () {
    $.ajax({
      url: 'http://localhost:8081/User/getUserList',//请求地址
      dataType: 'JSON',//值类型
      data: {
        page:1,
        limit:1,
        id:'',
        UName:'',
        Pwd:'',
        Address: '',
        Phone:''
      },//往后端发送的值
      success: function (res) {//成功的回调函数
        console.log(res.data)
        localStorage.setItem("id",res.data[0].id)
        $("#id").val(res.data[0].id)
        $("#UName").val(res.data[0].UName)
        $("#Pwd").val(res.data[0].Pwd)
        $("#Phone").val(res.data[0].Phone)
        $("#Address").val(res.data[0].Address)
      },
      error: function (data) {//失败的回调函数
        layer.alert("系统出错");
      }
    })

  })
function openPage() {
  layer.open({
    type: 2,
    title: '修改信息',
    shadeClose: true,
    shade: 0.8,
    area: ['580px', '60%'],
    content: 'user-up.html' //iframe的url
  });
}
</script>
  <script src="../layui/layui.js" charset="utf-8"></script>
<script>
  layui.use('table', function () {
    var table = layui.table;
    var $ = layui.jquery, upload = layui.upload;

    table.render({
      elem: '#Member',
      headers: {
        AccessKey: "1465465dfsafsdfhefas",
        AccessSecret: "645SDSAGBDFBasaasdsa"
      }
      , url: 'http://localhost:8081/Prevenient/getPrevenientList'
      , toolbar: '#memberToolbar' //开启头部工具栏，并为其绑定左侧模板
      , where: {
        id: 0,
        Pwd:"",
        Phone:"",
        Address:""
      }
      , title: '快递数据表'
      , cols: [[
        {type: 'checkbox', fixed: 'left'}
        , {field: 'id', title: 'Id', width: 80, fixed: 'left', unresize: true, sort: true}
        , {field: 'Pwd', title: '密码', width: 120, edit: 'text'}
        , {field: 'Phone', title: '手机号', width: 120, edit: 'text'}
        , {field: 'Address', title: '地址', width: 180, edit: 'text'}
      ]]
      , page: true
    });
  });
</script>
</body>
</html>